<!DOCTYPE html >
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>修改密码</title>
    <link rel="stylesheet" href="/static/home/bootstrap/css/bootstrap.min.css">
</head>

<body>
<div class='container' style="margin-bottom: 50px;margin-top: 20px">
    <div class='col-md-8'>
        <div class="form-group">
            <label>原始密码</label>
            <input id="nowpassword" class="form-control" type="password" id="nowpassword"/>
        </div>
        <div class="form-group">
            <label>密码</label>
            <input id="password" class="form-control" type="password" id="password"/>
        </div>
        <div class="form-group">
            <label>重复密码</label>
            <input id="repassword" class="form-control" type="password" id="password"/>
        </div>
        <div class="form-group">
            <div>
                <button id="button" class="btn btn-default">修改密码</button>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="/static//admin/formvalidator4.1.3/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        $("#button").click(function () {
            var p = $("#password").val();
            var rp = $("#repassword").val();
            var nowp=$("#nowpassword").val();
            if(p!=rp){
                alert("两次密码不一样")
                return true
            }
            if(p.length<=6){
                alert("密码不能小于6位")
                return true
            }
            $.post("/public/changepwd", {
                "nowpassword":nowp,
                "password": p,
                "repassword": rp,
                "isajax": 1
            }, function (data) {
                alert(data.info)
            })
            return true
        })
    </script>
</body>

</html>
